<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-06-17 09:36:21
 * @LastEditTime: 2019-09-25 10:51:14
 * @LastEditors: Please set LastEditors
 -->
<template>
  <div class="loading-bar" v-show="show">{{ tips }}</div>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      tips: '努力加载中...'
    }
  },
  methods: {
    update(options) {


      if (options.state === 'start') {
        this.show = true
        this.tips = '努力加载中...'
      } else if (options.state === 'error') {
          this.show = true
        this.tips = options.tips || '加载出错了'
      } else if (options.state === 'end') {
          this.show = true
        this.tips = options.tips || '没有更多了'
      } else {
        this.show = false
      }
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../../styles/libs/index.scss";

.loading-bar {
  height: 0.5rem;
  line-height: 0.5rem;
  background: $bdc;
  text-align: center;
}
</style>

